home *** CD-ROM | disk | FTP | other *** search
- /* DEC/CMS REPLACEMENT HISTORY, Element DECWDWTWIDGETPROG.H */
- /* 8 31-MAR-1988 12:07:33 TREGGIARI "BL7.3 UPDATE" */
- /* 7 24-MAR-1988 15:47:04 TREGGIARI "Replace with completely new version" */
- /* *6 27-FEB-1988 18:18:42 GEORGE "Add copyright" */
- /* *5 7-JAN-1988 13:04:06 TREGGIARI "Replace with completely new version" */
- /* *4 5-JAN-1988 15:36:56 TREGGIARI "Replace with completely new version" */
- /* *3 18-DEC-1987 14:06:03 TREGGIARI "Replace with completely new version" */
- /* *2 2-NOV-1987 17:13:57 TREGGIARI "Replace with completely new version" */
- /* *1 2-NOV-1987 14:52:49 ORGOVAN "Initial Entry" */
- /* DEC/CMS REPLACEMENT HISTORY, Element DECWDWTWIDGETPROG.H */
- /*
- *****************************************************************************
- ** *
- ** COPYRIGHT (c) 1988 BY *
- ** DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. *
- ** ALL RIGHTS RESERVED *
- ** *
- ** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED *
- ** ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE *
- ** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER *
- ** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY *
- ** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY *
- ** TRANSFERRED. *
- ** *
- ** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE *
- ** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT *
- ** CORPORATION. *
- ** *
- ** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS *
- ** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. *
- ** *
- *****************************************************************************
- **++
- ** FACILITY:
- **
- ** < to be supplied >
- **
- ** ABSTRACT:
- **
- ** < to be supplied >
- **
- ** ENVIRONMENT:
- **
- ** < to be supplied >
- **
- ** MODIFICATION HISTORY:
- **
- ** < to be supplied >
- **
- **--
- **/
-
- /* This include file contains definitions needed by widget developers. */
-
- #ifdef VAXC
- #define external globalref
- #define externaldef globaldef
- #else
- #define external extern
- #define externaldef
- #endif
-
- #define DECHINTS
-
- #include <string.h>
- #include <ctype.h>
- #include <decw$include/Atoms.h>
- #include <decw$include/IntrinsicP.h>
- #include <decw$include/CoreP.h>
- #include <decw$include/CompositeP.h>
- #include <decw$include/ConstraintP.h>
- #include <decw$include/ShellP.h>
- #include <decw$include/VendorP.h>
-
- #define WIDGETPROG 1
-
-
- typedef struct _DwtTextSourceRec *DwtTextSource;
-
- #include <decw$include/DECwDwtApplProg.h>
-
-
- /* core class procedure forward declarations */
-
- static void Initialize();
- static void Realize();
- static void Resize();
- static void Redisplay();
- static Boolean SetValues();
- static void ClassInitialize();
- static void Destroy();
-
-
- /*
- * composite class procedure forward dec's
- */
-
- static XtGeometryResult geometry_manager ();
- static void managed_set_changed ();
- static void add_child ();
- static void remove_child ();
-
-
- /*
- * all conversion strings
- */
-
- #define DwtSAlignmentCenter "alignmentcenter"
- #define DwtSAlignmentBeginning "alignmentbeginning"
- #define DwtSAlignmentEnd "alignmentend"
- #define DwtSFontDefault "helvetica_bold12"
- #define DwtSBlack "Black"
- #define DwtSWhite "White"
- #define DwtSTextString "text"
- #define DwtSPixmap "pixmap"
- #define DwtSOne "1"
- #define DwtSFour "4"
- #define DwtSNone "None"
- #define DwtSOpen "Open"
- #define DwtSAcknowledged "Acknowledged"
- #define DwtSFalse "False"
- #define DwtSTrue "True"
- #define DwtSZero "0"
- #define DwtSOrientationVertical "orientationvertical"
- #define DwtSOrientationHorizontal "orientationhorizontal"
- #define DwtSMenuPackingTight "menupackingtight"
- #define DwtSMenuPackingNone "menupackingnone"
- #define DwtSMenuPackingColumn "menupackingcolumn"
- #define DwtSScrollButton1 "ScrollButton1"
- #define DwtSScrollButton2 "ScrollButton2"
- #define DwtSYes "Yes"
- #define DwtSNo "No"
- #define DwtSCancel "Cancel"
- #define DwtSOk "Ok"
-
-
-
-
- /* macros */
-
- #define MIN(x,y) ((x) < (y) ? (x) : (y))
- #define MAX(x,y) ((x) > (y) ? (x) : (y))
-
- #define ASSIGN_MAX(x, y) if ((y) > (x)) x = (y)
- #define ASSIGN_MIN(x, y) if ((y) < (x)) x = (y)
-
- #define MAXHEIGHT ((1 << 31)-1)
- #define MAXWIDTH ((1 << 31)-1)
-
- #define MAXINT 2147483647 /* Biggest number that can fit in a long. */
-
- /* core access macros, will work */
- /* with any widget */
- #define XtX(w) ((w)->core.x)
- #define XtY(w) ((w)->core.y)
- #define XtWidth(w) ((w)->core.width)
- #define XtHeight(w) ((w)->core.height)
- #define XtBorderWidth(w) ((w)->core.border_width)
- #define XtBackground(w) ((w)->core.background_pixel)
- #define XtSensitive(w) ((w)->core.sensitive)
- #define XtParent(w) ((w)->core.parent)
- #define XtCoreProc(w,proc) ((w)->core.widget_class->core_class.proc)
- #define XtParentCoreProc(w,proc) \
- (((w)->core.parent)->core.widget_class->core_class.proc)
-
- /* composite widget access macros,*/
- /* will work w/ any composite */
-
- #define XtNumChildren(w) ((w)->composite.num_children)
- #define XtChildren(w) ((w)->composite.children)
-
- #define XtCompositeProc(w, proc) \
- (((CompositeWidgetClass) ((w)->core.widget_class))->composite_class.proc)
-
- #define XtParentCompositeProc(w, proc) \
- (((CompositeWidgetClass) (((w)->core.parent)->core.widget_class)) \
- ->composite_class.proc)
-
-
-
- /*
- * The DECtoolkit internal callback structure which maps the
- * external representation to the intrinsics internal representation
- */
- typedef struct
- {
- XtCallbackList ecallback; /* Xtoolkit callback list */
- }
- DwtCallbackStruct, *DwtCallbackStructPtr;
-
-
-
-
- /*-------------------*/
- /* dwt common widget */
- /*-------------------*/
-
- typedef struct {
- VoidProc optimal_size; /* procedure that returns optimal window box */
- } DwtCommonClassPart;
-
-
- typedef struct _DwtCommonClassRec {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- } DwtCommonClassRec, *DwtCommonClass;
-
- typedef struct {
- XFontStruct *font_struct;
- Pixel foreground_pixel;
- DwtCallbackStruct help_callback;
- Pixmap pixmap;
- int propagate_colors;
- Pixel highlight_pixel;
- Pixmap highlight_pixmap;
- Pixmap gray_pixmap;
- GC foreground_gc;
- GC background_gc;
- GC highlight_gc;
- GC slider_gc;
- Pixel slider_pixel;
- Pixmap slider_pixmap;
- int space4;
- } DwtCommonPart;
-
- typedef struct {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- } DwtCommonWidgetRec, *DwtCommonWidget;
-
- #ifndef DWTCOMMON
- external DwtCommonClass dwtcommonwidgetclass;
- external DwtCommonClassRec dwtcommonwidgetclassrec;
- #endif
-
-
- /*--------------*/
- /* text widget */
- /*--------------*/
-
- typedef struct _InputRec *Input;
- typedef struct _OutputRec *Output;
- typedef struct _TextDataRec *TextData;
- typedef struct _LineTableExtraRec *LineTableExtra;
-
- #define TEXTWIDGETCLASS "Text" /* Resource class for the text widget. */
-
- typedef struct {
- int notused;
- } TextClassPart;
-
- typedef struct _TextClassRec {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- TextClassPart text_class;
- } TextClassRec, *TextClass;
-
-
- typedef struct _TextRec {
- CorePart core;
- CompositePart composite;
- Widget innerwidget; /* Pointer to widget which actually */
- /* contains text (may be same or */
- /* different from this record). */
- DwtTextSource source; /* The source for this widget. */
- DwtCallbackStruct callback; /* Basic callback. */
- DwtCallbackStruct help_callback; /* Help callback. */
- DwtCallbackStruct focus_callback; /* Focus callback. */
- Output output; /* The output portion. */
- Input input; /* The input portion. */
- TextData text; /* The main text portion. */
- } TextWidgetRec, *TextWidget;
-
-
- #ifndef TEXT
- external WidgetClass textwidgetclass;
- external TextClassRec textwidgetclassrec;
- #endif
-
- #ifndef STEXT
- external TextClassRec stextwidgetclassrec;
- external WidgetClass stextwidgetclass;
- #endif
-
-
- /*--------------*/
- /* label widget */
- /*--------------*/
-
- /*
- * label internal struct to hold broken up lines of the label
- */
-
- typedef struct _Label_Line
- {
- char *text; /* ptr to actual chars */
- int pixel_width; /* current width of line, in pixels */
- int reserved[5];
- } DwtLabelRec, *DwtLabelArray;
-
-
-
-
- typedef struct { /* label class record */
-
- int dummy;
- } LabelClassPart;
-
-
- typedef struct _LabelClassRec { /* label full class record */
-
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- LabelClassPart label_class;
- } LabelClassRec, *LabelClass;
-
-
-
- typedef struct { /* label widget instance record */
- char *label;
- DwtLabelArray label_array;
- int label_type;
- int label_len;
-
- int alignment;
-
- Dimension margin_height; /* margin around widget */
- Dimension margin_width;
-
- int margin_left; /* additional margins on */
- int margin_right; /* each side of widget */
- int margin_top; /* text (or pixmap) is placed */
- int margin_bottom; /* inside the margins */
-
- int conform_to_text; /* T/F, if T we always try to */
- /* be big enough for our text */
- /* F - up to somebody else */
-
- unsigned int drawing_mode;
- XImage *image;
- Boolean selection_mode;
- Boolean text16;
-
- int reserved[4];
- } LabelPart;
-
-
-
- typedef struct _LabelRec { /* label full instance record */
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- LabelPart label;
- } LabelRec, *LabelWidget;
-
- #ifndef LABEL
- external LabelClassRec labelwidgetclassrec;
- external LabelClass labelwidgetclass;
- #endif
-
-
-
- /*-------------------*/
- /* pushbutton widget */
- /*-------------------*/
-
- /*
- * define the attributes (or things it does) that a pushbutton class has
- * that a label class doesn't
- */
-
- typedef struct
- {
- int moremumble; /* not much */
- }
- PushbuttonClassPart;
-
-
- /*
- * now define the actual pushbutton widget data struct
- */
-
- typedef struct _PushbuttonClassRec
- {
- CoreClassPart core_class; /* basic widget */
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- LabelClassPart label_class; /* label widget */
- PushbuttonClassPart pushbutton_class; /* pushbutton specific */
- }
- PushbuttonClassRec, *PushbuttonClass;
-
- /*
- * define the additional data a pushbutton class widget has that a
- * label widget doesn't
- */
-
- typedef struct
- {
- Boolean bordHighlight; /* border highlighted? */
- Boolean fillHighlight; /* fill highlighted? */
- Boolean armed; /* armed state indicator */
- DwtCallbackStruct activate_callback, /* button fired off callback */
- arm_callback, /* button now armed callback */
- disarm_callback; /* button disarmed call back */
- }
- PushbuttonPart;
-
-
-
-
- typedef struct _PushbuttonRec
- {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- LabelPart label;
- PushbuttonPart pushbutton;
- }
- PushbuttonRec, *PushbuttonWidget;
-
- #ifndef PUSHBUTTON
- external PushbuttonClassRec pushbuttonwidgetclassrec;
- external PushbuttonClass pushbuttonwidgetclass;
- #endif
-
-
-
- /*---------------------*/
- /* togglebutton widget */
- /*---------------------*/
-
- /*
- * define the attributes (or things it does) that a togglebutton class has
- * that a label class doesn't
- */
-
- typedef struct
- {
- int moremumble; /* not much */
- }
- TogglebuttonClassPart;
-
-
- /*
- * now define the actual togglebutton widget data struct
- */
-
- typedef struct _TogglebuttonClassRec
- {
- CoreClassPart core_class; /* basic widget */
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- LabelClassPart label_class; /* label widget */
- TogglebuttonClassPart togglebutton_class; /* togglebutton specific */
- }
- TogglebuttonClassRec, *TogglebuttonClass;
-
- /*
- * define the additional data a togglebutton class widget has that a
- * label widget doesn't
- */
-
- typedef struct
- {
- Boolean armed; /* T/F, for armed state */
-
- unsigned int value; /* state of toggle button */
-
- int spacing; /* pixels between indicator */
- /* and the label */
-
- int shape; /* indicator shape, square or */
- /* oval */
-
- unsigned int visibleWhenOff; /* T/F, for indicator */
-
- Boolean indicator_bdr_highlight;
- /* T/F, for indicator border */
- /* highlighting */
-
- int indicator_x, /* indicator location */
- indicator_y;
-
- int indicator_width; /* indicator size */
- int indicator_height;
-
- DwtCallbackStruct value_change_callback, /* button changed callback */
- arm_callback, /* is now armed callback */
- disarm_callback; /* is now disarmed callback */
-
- Pixmap pixmap_on, /* these two are the pixmaps */
- pixmap_off; /* which are used instead */
- /* of text */
- }
- TogglebuttonPart;
-
-
-
-
- typedef struct _TogglebuttonRec
- {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- LabelPart label;
- TogglebuttonPart togglebutton;
- }
- TogglebuttonRec, *TogglebuttonWidget;
-
- #ifndef TOGGLEBUTTON
- external TogglebuttonClassRec togglebuttonwidgetclassrec;
- external TogglebuttonClass togglebuttonwidgetclass;
- #endif
-
-
-
-
-
-
- /*************************************************************************
- *
- * Hidden Shell widget (Same as Intrinsics shell, except for managechanged
- * semantics
- */
-
- /*
- * define the additional data a shell class widget has that a
- * shell widget doesn't
- */
-
- typedef struct
- {
- XtGrabKind grabkind;
- }
- HiddenShellPart;
-
- /*
- * now define the actual hidden shell widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- ShellPart shell; /* shell specific data */
- WMShellPart wm;
- VendorShellPart vendor;
- TopLevelShellPart topLevel;
- HiddenShellPart hiddenshell; /* hidden shell specific */
- }
- HiddenShellWidgetRec, *HiddenShellWidget;
-
- /*
- * define the attributes (or things it does) that a hidden shell class has
- * that a shell class doesn't
- */
-
- typedef struct
- {
- int mumble;
- }
- HiddenShellClassPart;
-
-
- typedef struct _HiddenShellClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ShellClassPart shell_class;
- WMShellClassPart wm_shell_class;
- VendorShellClassPart vendor_shell_class;
- TopLevelShellClassPart top_level_shell_class;
- HiddenShellClassPart hidden_shell_class;
- }
- HiddenShellClassRec, *HiddenShellClass;
-
- #ifndef HIDDENSHELL
- external HiddenShellClassRec hiddenshellwidgetclassrec;
- external HiddenShellClass hiddenshellwidgetclass;
- #endif
-
-
-
-
-
- /*************************************************************************
- *
- * dialog box widget
- */
-
-
- /*
- * define the additional data a dialog class widget has that a
- * composite widget doesn't
- */
-
- typedef struct
- {
- int title_type; /* type of title */
- char *title; /* title of dialog window */
-
- int style; /* type of dialog box */
-
- int defaultposition; /* T/F, appear centered */
- /* in parent's window */
-
- Widget current_focus; /* child with the input focus */
-
- int margin_width, /* these are white space left */
- margin_height; /* around bottom and right of */
- /* dialog widget */
-
- Widget shell; /* Shell widget for modal and */
- /* modeless style */
-
- Widget default_button; /* Pushbutton widget for the */
- /* default push button */
-
- Widget cancel_button; /* Pushbutton widget for the */
- /* cancel push button */
-
- DwtCallbackStruct help_callback, /* help callback */
- select_callback, /* widget editor callback */
- map_callback, /* about to be mapped */
- unmap_callback, /* just been unmapped */
- focus_callback; /* grabbed input focus */
-
- XtTranslations texttranslations; /* translations merged into */
- /* text fields */
-
- int units; /* font or pixel positioning */
- /* for our children */
-
- XFontStruct *font_struct; /* font to use if we are */
- /* doing font positioning */
-
- float scale_x, /* pixels per font unit */
- scale_y;
-
- int auto_unmanage; /* T/F automatically unmanage */
- /* a modal dialog box */
-
- }
- DialogPart;
-
-
-
- /*
- * now define the actual dialog widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- ConstraintPart constraint;
- DialogPart dialog; /* dialog specific */
- }
- DialogWidgetRec, *DialogWidget;
-
- /*
- * define the attributes (or things it does) that a dialog class has
- * that a composite class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- DialogClassPart;
-
-
- typedef struct _DialogClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- DialogClassPart dialog_class;
- }
- DialogClassRec, *DialogClass;
-
- #ifndef DIALOG
- external DialogClassRec dialogwidgetclassrec;
- external DialogClass dialogwidgetclass;
- #endif
-
-
-
-
-
-
- /**************************************************************************
- *
- * menu popup shell widget and class definition
- */
-
- typedef struct
- {
- int mumble;
- }
- MenuPopupPart;
-
-
- /*
- * now define the actual popup menu widget data struct
- */
-
- typedef struct
- {
- CorePart core;
- CompositePart composite;
- ShellPart shell;
- OverrideShellPart override;
- MenuPopupPart popup;
- }
- MenuPopupRec, *MenuPopupWidget;
-
-
-
-
- /*
- * define the attributes (or things it does) that a popup menu class has
- * that a shell widget class doesn't
- */
-
- typedef struct
- {
- int mumble;
- }
- MenuPopupClassPart;
-
-
-
- typedef struct
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ShellClassPart shell_class;
- OverrideShellClassPart override_shell_class;
- MenuPopupClassPart popup_part;
- }
- MenuPopupClassRec, *MenuPopupWidgetClass;
-
-
-
-
-
- #ifndef POPUPMENU
- external MenuPopupClassRec menupopupClassRec;
- external WidgetClass menupopupWidgetClass;
- #endif
-
-
-
-
-
-
- /**************************************************************************
- *
- * menu widget data and class definitions, menu is a subclass of dialog
- */
-
- /*
- * define the data fields which a menu widget has that a dialog widget
- * does not
- */
-
-
- typedef struct
- {
- int type; /* temporary: diff between menu/bar */
-
- int orientation; /* horizontal or vertical */
-
- /* next two indicate how the widget */
- /* responds to size changes if there */
- /* is no geo mgr. If true then the */
- /* dimension is never changed. Set */
- /* to true if dimension is spec'd */
- /* at create time */
- int fixed_width;
- int fixed_height;
-
- Dimension margin_height; /* margin around inside of widget */
- Dimension margin_width;
-
-
- int spacing; /* pixels between entries */
-
- int entry_border; /* size of entry borders */
-
- /* next three only used w/ menubars */
-
- int help_enabled; /* do we show a help pushbutton */
-
- Widget help_pushbutton;/* ptr to help pushbutton widget */
-
- Widget pulldown; /* if this menu is pulled down by a */
- /* pulldown widget this will point */
- /* at the pulldown. needed to go */
- /* up the cascade */
-
- int armed; /* controls whether pulldowns work */
- /* or not, button down in any part of */
- /* the menubar arms it */
-
- /* next is only valid for popup menus */
-
- int popup_memory; /* keep a vertical bias for use w/ */
- /* popup menus so that the menu will */
- /* popup with the last item selected */
- /* underneath the mouse */
-
- /* next two only used w/ option menus */
- /* they are really only temporary */
- /* since the data is passed off to */
- /* the pulldown widget which is */
- /* automatically built */
-
- char *option_label; /* label for option menu pulldown */
-
- Widget option_submenu; /* which submenu to pulldown */
-
-
- XtWidgetGeometry *boxes; /* when doing menu layouts is an */
- /* array of geo req's to make it easy */
-
-
- int adjust_margin; /* T/F, indicating if we should force */
- /* all subwidgets to have similar */
- /* margins */
-
-
- int do_alignment; /* T/F, do we force alignment on all */
- /* our children */
-
- int entry_alignment; /* type of label alignment */
- /* our children should have */
-
- /* next two are layout, Tight is the */
- /* standard menubar packing. Columns */
- /* is radio box style, orientation */
- /* determines if it is column or row */
- /* major, Vert = column major */
-
- int packing; /* entry packing (layout) style */
-
- int num_columns; /* if columnar packing this is how */
- /* many columns to use */
-
-
- int radio; /* T/F, do we do the toggle button */
- /* 'only-one-down' enforcement */
-
- int radio_one; /* T/F, must have one radio button */
- /* set to on */
-
-
- int homogeneous; /* T/F, do we only allow a single */
- /* class of children */
-
- WidgetClass entry_class; /* if homogeneous, what class */
-
- DwtCallbackStruct entry_callback, /* a child fired off */
- select_callback,/* widget editor callback */
- map_callback, /* about to be mapped call back */
- unmap_callback; /* about to be unmapped call back */
- }
- MenuPart;
-
-
-
- /*
- * now define the actual menu widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon; /* decw common data */
- MenuPart menu; /* menu special */
- }
- MenuWidgetRec, *MenuWidget;
-
-
-
- /*
- * define the attributes (or things it does) that a menu class has
- * that a dialog class doesn't
- */
-
- typedef struct
- {
- VoidProc position; /* proc to compute the position of */
- /* a popup/pulldown menu, should */
- /* be called just before managing */
- /* the menu. Calling params are the */
- /* menu to position and for popup */
- /* menus, a pointer to an XEvent. */
-
- VoidProc preferred_size; /* proc to find out what size a menu */
- /* wants to be. Called with the menu */
- /* and ptr to width, ptr to height */
- /* Either width or height (or both) */
- /* can be 0, this is interpreted as */
- /* unrestricted. Returns size needed */
- /* to display menu */
- }
- MenuClassPart;
-
-
-
-
- typedef struct _MenuClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- MenuClassPart menu_class;
- }
- MenuClassRec, *MenuWidgetClass;
-
-
- #ifndef MENU
- external MenuClassRec menuwidgetclassrec;
- external MenuWidgetClass menuwidgetclass;
- #endif
-
-
-
-
-
-
-
-
- /************************************************************************
- *
- * define the pulldown menu entry widget. this is a subclass of label widget
- * and almost a subclass of pushbutton. however, since it has a highlight
- * state that is not tied to operator events it is easier to make it a
- * subclass of label rather than pushbutton
- */
-
-
- /*
- * define the stuff that only appears in pulldown widgets
- */
-
- typedef struct
- {
- DwtCallbackStruct activate_callback, /* widget fired callback */
- select_callback, /* widget editor callback */
- pulling_callback; /* optional callback, called */
- /* when the menu is about */
- /* to be pulled down */
-
- int hot_spot; /* obsolete */
-
- XtTranslations hot_events; /* hot spot translations */
- XtActionList hot_actions; /* hot spot action table */
-
- Widget hot_widget; /* subwidget for hotspot */
-
- int pulled_down; /* T/F, state of our submenu */
-
- Widget submenu; /* the menu to pull down */
-
- Pixmap hot_pixmap; /* pixmap for the hot spot */
- }
- PulldownPart;
-
-
-
-
- /*
- * now define the actual pulldown widget data struct
- */
-
- typedef struct
- {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- LabelPart label;
- PulldownPart pulldown;
- }
- PulldownWidgetRec, *PulldownWidget;
-
-
-
-
-
- /*
- * define the attributes (or things it does) that a pulldown class has
- * that a label class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- PulldownClassPart;
-
-
-
-
- typedef struct _PulldownClassRec
- {
- CoreClassPart core_class; /* basic widget */
- CompositeClassPart composite_class; /* Composite widget */
- DwtCommonClassPart dwtcommon_class; /* Decwindow common */
- LabelClassPart label_class; /* label widget */
- PulldownClassPart pulldown_class; /* pulldown specific */
- }
- PulldownClassRec, *PulldownWidgetClass;
-
-
- #ifndef PULLDOWN
- external PulldownClassRec pulldownwidgetclassrec;
- external PulldownWidgetClass pulldownwidgetclass;
- #endif
-
-
- /*------------*/
- /* scroll bar */
- /*------------*/
-
-
- typedef struct
- {
-
- Widget button1;
- Widget button2;
- int *translations1;
- int *translations2;
- Pixmap button1_pixmap;
- Pixmap button2_pixmap;
- int orientation;
- int shown; /* fraction shown in window */
- int inc; /* what increment of the */
- /*scroll buttons are */
- int pageinc; /* What the increment of /*
- /* the page are */
- int value; /* current value */
- int maxvalue; /* max value returned */
- int minvalue; /* min value returned */
- int oldx1, oldx2;
- int oldy1, oldy2; /* last thumb position */
- Boolean thumb_redraw; /* redraw entire thumb flag */
- Boolean got_thumb; /* true if thumb is grabbed */
- Boolean drag_start; /* denotes drag starting */
- Boolean drag_end; /* denotes drag ending */
- Boolean pixmap_flag; /* bkgrnd pixmap is scroll's */
- int dx1, dx2, dy1, dy2; /* origional pos of the */
- /* thumb during drab */
- int grabx, graby; /* position of grab */
- int dvalue; /* original pos during grab */
- int notify; /* notify flag */
- DwtCallbackStruct unit_inc_callback,
- unit_dec_callback,
- page_inc_callback,
- page_dec_callback,
- drag_callback,
- to_bottom_callback,
- to_top_callback,
- callback,
- to_position_callback;
-
- } ScrollPart;
-
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon;
- ScrollPart scroll;
- }
- ScrollWidgetRec, *ScrollWidget;
-
- typedef struct
- {
- int dummy;
- } ScrollClassPart;
-
- typedef struct _ScrollClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- ScrollClassPart scroll_class;
- }
- ScrollClassRec, *ScrollClass;
-
-
- #ifndef SCROLL
- external ScrollClassRec scrollwidgetclassrec;
- external ScrollClass scrollwidgetclass;
- #endif
-
-
-
-
-
-
- /**************************************************************************
- *
- * main window widget data and class definitions
- */
-
- typedef struct
- {
- Widget command_window,
- work_window,
- menu_bar,
- h_scroll,
- v_scroll;
- }
- MainWindowPart;
-
- /*
- * now define the actual main window widget data structure
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon;
- MainWindowPart main_window; /* main specific */
- }
- MainWindowWidgetRec, * MainWindowWidget;
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- MainWindowClassPart;
-
- typedef struct _MainWindowClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- MainWindowClassPart main_window_class;
- }
- MainWindowClassRec, * MainWindowWidgetClass;
-
-
- #ifndef MAIN
- external MainWindowClassRec mainwindowwidgetclassrec;
- external MainWindowWidgetClass mainwindowwidgetclass;
- #endif
-
-
-
- /*************************************************************************
- *
- * message box widget
- */
-
- /*
- * define the additional data a message class widget has that a
- * composite widget doesn't
- */
-
- typedef struct
- {
- int type;
- char *label;
- int labeltype;
-
- char *yeslabel;
- int yeslabeltype;
- DwtCallbackStruct yes_callback;
-
- char *nolabel;
- int nolabeltype;
- DwtCallbackStruct no_callback;
-
- char *cancellabel;
- int cancellabeltype;
- DwtCallbackStruct cancel_callback;
-
- char *oklabel;
- int oklabeltype;
-
- Widget iconwid;
-
- Widget labelwid,
- yeslabelwid,
- nolabelwid,
- cancellabelwid;
-
- int default_pb;
- }
- MessagePart;
-
- /*
- * now define the actual message widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- ConstraintPart constraint;
- DialogPart dialog; /* dialog specific */
- MessagePart message; /* message specific */
- }
- MessageWidgetRec, *MessageWidget;
-
- /*
- * define the attributes (or things it does) that a message class has
- * that a composite class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- MessageClassPart;
-
-
- typedef struct _MessageClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- DialogClassPart dialog_class;
- MessageClassPart message_class;
- }
- MessageClassRec, *MessageClass;
-
- #ifndef MESSAGE
- external MessageClassRec messagewidgetclassrec;
- external MessageClass messagewidgetclass;
- #endif
-
-
- /*************************************************************************
- *
- * window widget
- */
-
- typedef struct
- {
- DwtCallbackStruct expose_callback;
- }
- WindowPart;
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon;
- WindowPart window;
- }
- WindowWidgetRec, *WindowWidget;
-
-
- typedef struct
- {
- int dummy;
- }
- WindowClassPart;
-
-
- typedef struct _WindowClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- WindowClassPart window_class;
- }
- WindowClassRec, *WindowClass;
-
-
- #ifndef WINDOW
- external WindowClassRec windowwidgetclassrec;
- external WindowClass windowwidgetclass;
- #endif
-
-
-
-
-
-
- /*************************************************************************
- *
- * scroll window widget
- */
-
- typedef struct {
-
- Widget hscroll;
- Widget vscroll;
- Widget wregion;
-
- } ScrollWindowPart;
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon;
- ScrollWindowPart scrollwindow;
- }
- ScrollWindowWidgetRec, *ScrollWindowWidget;
-
- typedef struct
- {
- int dummy;
- } ScrollWindowClassPart;
-
- typedef struct _ScrollWindowClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- ScrollWindowClassPart scrollwindow_class;
- }
- ScrollWindowClassRec, *ScrollWindowClass;
-
-
- #ifndef SCROLLWINDOW
- external ScrollWindowClassRec scrollwindowwidgetclassrec;
- external ScrollWindowClass scrollwindowwidgetclass;
- #endif
-
-
-
- /*-----------------*/
- /* list box widget */
- /*-----------------*/
-
- /*
- * define the attributes (or things it does) that a list box class has
- * that a scroll window class doesn't
- */
-
- typedef struct
- {
- int moremumble; /* not much */
- }
- ListBoxClassPart;
-
-
- /*
- * now define the actual list box widget data struct
- */
-
- typedef struct _ListBoxClassRec
- {
- CoreClassPart core_class; /* basic widget */
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- ScrollWindowClassPart scrollwindow_class; /* scrollwindow widget */
- ListBoxClassPart listbox_class; /* listbox specific */
- }
- ListBoxClassRec, *ListBoxClass;
-
- /*
- * define the additional data a listbox class widget has that a
- * scrollwindow widget doesn't
- */
-
- typedef struct
- {
- MenuWidget menu; /* menu used in list box */
- int vis_menu_width; /* visiblbe menu width */
- int vis_menu_height; /* visible menu height */
- ScrollWidget scrollbar; /* scroll bar used in list box */
- ScrollWidget hscrollbar; /* scroll bar used in list box */
- int hscroll_height; /* horiz scroll bar height */
- char **items; /* ptr to list of items */
- int itemsCount; /* number of items */
- char **selectedItems; /* list of selected items */
- int selectedItemsCount; /* number of selected items */
- int visibleItemsCount; /* number of visible items */
- Boolean resize; /* resize to fit all items */
- Boolean singleSelection; /* single item selection mode */
- Boolean selection_mode; /* selection mode indicator */
- DwtCallbackStruct single_callback, /* single select callback */
- singlec_callback, /* single select and confirm callback */
- extend_callback, /* extend select callback */
- extendc_callback; /* extend select and confirm callback */
- }
- ListBoxPart;
-
-
- typedef struct _ListBoxRec
- {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- ScrollWindowPart scrollwindow;
- ListBoxPart listbox;
- }
- ListBoxRec, *ListBoxWidget;
-
-
- #ifndef LISTBOX
- external ListBoxClassRec listboxwidgetclassrec;
- external ListBoxClass listboxwidgetclass;
- #endif
-
- /*------------*/
- /* scale */
- /*------------*/
-
-
- typedef struct
- {
-
- int orientation;
- int value; /* current value */
- int maxvalue; /* max value that can be returned */
- int minvalue; /* min value that can be returnes */
- int oldx1,oldx2;
- int oldy1,oldy2; /* last thumb position */
- Boolean thumb_redraw; /* redraw entire thumb flag */
- Boolean got_thumb; /* true if thumb is grabbed */
- Boolean drag_start; /* denotes drag starting */
- Boolean drag_end; /* denotes drag ending */
- Boolean pixmap_flag; /* denotes the background pixmap is scroll's */
- int dx1,dx2,dy1,dy2; /* origional posof the thumb during drab */
- int grabx, graby; /* position of grab */
- int dvalue; /* original values during grab */
- int scale_scx; /* actual drawing box on the screen for */
- int scale_scy; /* the scale rectangle */
- int scale_scw;
- int scale_sch;
- DwtCallbackStruct drag_callback;
- DwtCallbackStruct callback;
-
- int title_type;
- int slider_label_type;
- char *title;
- DwtLabelArray title_array;
- char *slider_label;
- DwtLabelArray slider_label_array;
- int scale_width;
- int scale_height;
- int scale_x;
- int scale_y;
- int decimal_points;
- int grab_oldvalue;
- Boolean show_value;
- Boolean show_value_automatic;
- Pixmap slider_pixmap;
-
- } ScalePart;
-
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- DwtCommonPart dwtcommon;
- ScalePart scale;
- }
- ScaleWidgetRec, *ScaleWidget;
-
- typedef struct
- {
- int dummy;
- } ScaleClassPart;
-
- typedef struct _ScaleClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- DwtCommonClassPart dwtcommon_class;
- ScaleClassPart scale_class;
- }
- ScaleClassRec, *ScaleClass;
-
-
- #ifndef SCALE
- external ScaleClassRec scalewidgetclassrec;
- external ScaleClass scalewidgetclass;
- #endif
-
-
- /*************************************************************************
- *
- * command box widget
- */
-
- typedef struct _recall_node
- {
- struct _recall_node *next;
- struct _recall_node *prev;
- char *pointer;
- } recall_node;
-
-
- /*
- * define the additional data a command class widget has
- */
- typedef struct
- {
- int lines;
- char *value;
- char *prompt;
- char *history;
- int prompttype;
- int historytype;
- int paste_flag;
- XtTranslations ttranslation;
- Widget valuewid;
- Widget promptwid;
- Widget historywid;
- recall_node *recall_list,
- *recall_pointer;
- DwtCallbackStruct callback;
- }
- CommandPart;
-
- /*
- * now define the actual command widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- ConstraintPart constraint;
- DialogPart dialog; /* dialog specific */
- CommandPart command; /* command specific */
- }
- CommandWidgetRec, *CommandWidget;
-
- /*
- * define the attributes (or things it does) that a command class has
- * that a composite class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- CommandClassPart;
-
-
- typedef struct _CommandClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- DialogClassPart dialog_class;
- CommandClassPart command_class;
- }
- CommandClassRec, *CommandClass;
-
- #ifndef COMMAND
- external CommandClassRec commandwidgetclassrec;
- external CommandClass commandwidgetclass;
- #endif
-
-
- /*************************************************************************
- *
- * file selection widget
- */
-
- /*
- * define the additional data a file selection class widget has that a
- * composite widget doesn't
- */
-
- typedef struct
- {
- char *title; /* title in window banner */
- int labeltype; /* either DwtText or Text16 */
- char *label; /* label before text widget */
- Boolean text16; /* text widget text type */
- char *value; /* current selection or reqeust */
- int system_preference; /* VMS, UNIX or MSDOS */
- char *dir_mask; /* file search key */
- int read;
- int write;
- int execute;
- int delete;
- int cancellabeltype;
- char *cancellabel;
- int oklabeltype;
- char *oklabel;
- Boolean selection_mode; /* selection mode indicator */
- DwtCallbackStruct callback, /* OK callback */
- cancel_callback; /* Cancel callback */
- LabelWidget labelwid;
- TextWidget textwid;
- ListBoxWidget listboxwid;
- PushbuttonWidget okwid;
- PushbuttonWidget cancelwid;
- char **files; /* ptr to list of files */
- int fileCount; /* number of files */
- int vis_files; /* number of vis file in lb */
- Boolean list_updated; /* list change indicator */
- XtWidgetProc file_search_proc; /* file search routine */
- }
- FileSelectionPart;
-
- /*
- * now define the actual file selection widget data struct
- */
-
- typedef struct
- {
- CorePart core; /* basic widget */
- CompositePart composite; /* composite specific data */
- ConstraintPart constraint;
- DialogPart dialog; /* dialog specific */
- FileSelectionPart fileselection; /* file selection specific */
- }
- FileSelectionWidgetRec, *FileSelectionWidget;
-
-
- /*
- * define the attributes (or things it does) that a message class has
- * that a composite class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- FileSelectionClassPart;
-
-
- typedef struct _FileSelectionClassRec
- {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- DialogClassPart dialog_class;
- FileSelectionClassPart fileselection_class;
- }
- FileSelectionClassRec, *FileSelectionClass;
-
- #ifndef FILESELECTION
- external FileSelectionClassRec fileselectionwidgetclassrec;
- external FileSelectionClass fileselectionwidgetclass;
- #endif
-
-
-
-
-
-
-
- /************************************************************************
- *
- * define the separator widget. this is a subclass of label widget
- */
-
-
- /*
- * define the stuff that only appears in separator widgets
- */
-
- typedef struct
- {
- int orientation; /* horiz or vert */
- }
- SeparatorPart;
-
-
-
-
- /*
- * now define the actual widget data struct
- */
-
- typedef struct
- {
- CorePart core;
- CompositePart composite;
- DwtCommonPart dwtcommon;
- LabelPart label;
- SeparatorPart separator;
- }
- SeparatorWidgetRec, *SeparatorWidget;
-
-
-
-
-
- /*
- * define the attributes (or things it does) that a Separator class has
- * that a label class doesn't
- */
-
- typedef struct
- {
- int mumble; /* nothing special */
- }
- SeparatorClassPart;
-
-
-
-
- typedef struct
- {
- CoreClassPart core_class; /* basic widget */
- CompositeClassPart composite_class; /* Composite widget */
- DwtCommonClassPart dwtcommon_class;
- LabelClassPart label_class; /* label widget */
- SeparatorClassPart separator_class; /* separator specific */
- }
- SeparatorClassRec, *SeparatorWidgetClass;
-
-
- #ifndef SEPARATOR
- external SeparatorClassRec separatorwidgetclassrec;
- external SeparatorWidgetClass separatorwidgetclass;
- #endif
-
-
-
-